const { Sequelize} = require('sequelize')

const mysqlServe = new Sequelize('dream_reason_koa_cli', 'root', 'root', {
    host: 'mysql',
    port: 3306,
    dialect: 'mysql'
})

try {
    mysqlServe.authenticate();
    console.log('Connection has been established successfully.');
  } catch (error) {
    console.error('Unable to connect to the database:', error);
  }

  mysqlServe.sync({ alter: false });

  module.exports = mysqlServe